-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function: add support for absent() #152
Conversation
http_requests_total{pod="nginx-1"} 0 | ||
http_requests_total{pod="nginx-2"} 1`, | ||
query: "absent(http_requests_total[30s])", | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add another test case where there is no data matching the queried series at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i will try
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like CI failure is related.
can you suggest how i can fix this |
execution/function/functions.go
Outdated
@@ -66,6 +66,21 @@ var Funcs = map[string]FunctionCall{ | |||
"asinh": simpleFunc(math.Asinh), | |||
"acosh": simpleFunc(math.Acosh), | |||
"atanh": simpleFunc(math.Atanh), | |||
"absent": func(f FunctionArgs) promql.Sample{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we need to fix the series labels. Please refer to upstream Prometheus and see how it implements absent https://github.com/prometheus/prometheus/blob/main/promql/functions.go#L591
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should i try to implement functions in promql-engine in similar way as promql function in prometheus
@zeus2611 you can run |
Signed-off-by: Nischay [email protected]
add support for absent(), related issue #138